$(function(){ 
	showCondition(true, 0, 0, 1,[]);//加载查询条件
	var param = drgUI.setAjaxData(tabId) ;
	param.pType = "1" ;
	$.post(contextPath + "/payGroup/findPayGroupDetails.dhc", param ).done(function(data) {
  		var columns=[
  		               	{"data": "ddesc","title":"DRG代码及描述",
  		               		"render": function(obj, type, full) {
  		               			return "<a drgCode=\""+full.CCODE+"\">"+full.CCODE+"-"+full.DDESC+"</a>" ;
  			                 }
  		           		},
  		               	{"data": "PAYGROUPCASECNT","title":"病例数" },
  		               	{"data": "","title":"病例数全院占比（%）",
  		       				"render": function(obj, type, full) {
  		       					return formatNumPayGroup(full.PAYGROUPCASECNTR*100,2) ;
  			                 }
  		               	},
  		               	{"data": "EXCESSCNT_F","title":"费用超标病例数"},
  		           		{"data": "EXCESSCNT_FR","title":"超标病例占比（%）",
  		           			"render": function(obj, type, full) {
  		           				return formatNumPayGroup(full.EXCESSCNT_FR*100,2) ;
  		           			 }
  		           		},
  		           		{"data": "AVGFEE","title":"次均费用",
  		           			"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.AVGFEE,2);
  		           			}
  		           		},
  		           		{"data": "AVGFEESTD","title":"次均费用标杆" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.AVGFEESTD,2);
  		           			}
  		           		},
  		           		{"data": "DRUGFEE","title":"药品费用" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.DRUGFEE,2);
  		           			}
  		           		},
  		           		{"data": "DRUGFEER","title":"药占比（%）" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.DRUGFEER*100,2);
  		           			}
  		           		},
  		           		{"data": "MATERFEER","title":"耗材占比（%）" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.MATERFEER*100,2);
  		           			}
  		           		},
  		           		{"data": "AVGDAYS","title":"平均住院日" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.AVGDAYS,2);
  		           			}
  		           		},
  		           		{"data": "MEDFEE","title":"医疗费用" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.MEDFEE,2);
  		           			}
  		           		},
  		           		{"data": "NURSFEE","title":"护理费用" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.NURSFEE,2);
  		           			}
  		           		},
  		           		{"data": "MANAGEFEE","title":"管理费用" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.MANAGEFEE,2);
  		           			}
  		           		},
  		           		{"data": "TECHFEE","title":"医技费用" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.TECHFEE,2);
  		           			}
  		           		},
  		           		{"data": "DRUGMATERFEE","title":"药品耗材费用" ,
  		               		"render": function(obj, type, full) {
  		               			return formatNumPayGroup(full.DRUGMATERFEE,2);
  		           			}
  		           		}
  	           ];
  		var paramsDataTables={ordering:false,stateSave:true,tableTitle:"DRG病组列表",columnDefs:[{"orderable": false,"targets": [ 0 ] }]};
  		$("#"+tabId+" #drgslistTab").dataTableBasic(columns,data.data,paramsDataTables) ;
        $("#" +tabId+" #drgslistTab").on("click","a",function() {
            var drgCode = $(this).attr("drgCode") ;
            var param = jQuery.extend(true, {}, paramTabPage[tabId]);
            param.pType = "1" ;
            param.pardrgCode = drgCode ;
            param.desc = $(this).html() ;
            openTab('/pages/paygroup/paygroupAnalysis_drg.jsp', drgCode + "病组费用分析", "paygroupAnalysis_drg" , "paygroupAnalysis_drg", param);
        }) ;
	})
})

